import React from 'react';
import PropTypes from 'prop-types'
import './index.scss';
import Breadcrumbs from '../../components/breadcrumbs/index';
import UserRegist from './regist/index';
import UserLogin from './login/index';

class UserContainer extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      imgList: [],
      showImgIndex: 0,
    }
  }
  componentDidMount() {

  }
  componentWillUnmount() {
  }
  render() {
    let user
    if (this.props.urlParams.type === 'regist') {
      user = <UserRegist />;
    } else if (this.props.urlParams.type === 'login') {
      user = <UserLogin redirect={this.props.urlParams.redirect} />;
    }
    return (
      <div className="user-container">
        <div className="w">
          <div className="container">
            <Breadcrumbs currentTitle={this.props.urlParams.type === 'regist' ? '注册' : '登录'} />
            {user}
          </div>
        </div>
      </div>
    )
  }
}
export default UserContainer;
UserContainer.propTypes = {
  urlParams: PropTypes.objectOf(Object),
}
